<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div
      class="outline-parent-bg border-hover-style"
      :class="{ 'null-sub-img': !props.info.value && !props.info.subTitle }"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style9/secondLevelStyle1Bg.webp'})`,
      }"
    >
      <div class="showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        v-if="props.info.text"
        :style="{
          backgroundImage:
            props.info.text.length > 12
              ? `url(${publicUrls + 'free/style9/secondLevelStyle1TitleIcon.webp'})`
              : `url(${publicUrls + 'free/style9/secondLevelStyle1TitleIcon2.webp'})`,
        }"
      >
        <p class="title">{{ props.info.text }}</p>
      </div>
      <div class="sub-title-box" v-if="props.info.subTitle">
        <p class="sub-title">——{{ props.info.subTitle }}</p>
      </div>
      <div class="line" v-if="props.info.subTitle"></div>
      <div
        class="unit-img-box"
        :class="{ 'unit-img-box2': !props.info.remarks && !props.info.subTitle }"
        v-if="props.info.value"
      >
        <img
          @click="ImgVisible = true"
          :src="urls + props.info.value + '?imageView2/3/format/webp'"
          alt=""
          class="unit-img"
        />
      </div>
      <div class="remarks1" v-if="props.info.value && props.info.remarks">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="5"
        ></TextMax>
      </div>
      <div class="remarks2" v-else-if="props.info.remarks">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="12"
        />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free9Style1',
});
</script>
<script lang="ts" setup>
import { publicUrls } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style9.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax9.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style lang="less" scoped>
.outline-parent {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-right: 160px;
}
.outline-parent-bg {
  position: relative;
  width: 520px;
  height: 774px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  // justify-content: space-between;
  padding-right: 15px;
  padding-top: 90px;
  padding-bottom: 98px;
}
.showroom-parent {
  position: absolute;
  bottom: 13px;
  right: 49px;
  z-index: 21;
  width: 40px;
  height: 40px;
}
::v-deep .tooltip-content {
  bottom: 48px !important;
}
::v-deep .t-popup__arrow::before {
  bottom: -23px;
}
.title-box {
  flex-shrink: 0;
  width: 344px;
  // height: 50px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.title {
  width: 300px;
  text-align: center;
  // text-shadow: 0px 1px 0px #d5c8b2, 0px 2px 2px rgba(0, 0, 0, 0.1);
  /* 二级标题 */
  font-family: 'SourceHanSerifCN';
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 36px; /* 150% */
  background: radial-gradient(53.61% 73.58% at 50% 15.31%, #b1987f 0%, #8a7a6a 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateY(-20px);
}
.sub-title-box {
  width: 380px;
  flex-shrink: 0;
  margin-top: 17px;
}
.sub-title {
  color: #8a7a6a;

  text-align: center;
  /* 二级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
}
.line {
  width: 380px;
  height: 2px;
  flex-shrink: 0;
  background-color: #d8cbb6;
  box-shadow: 0px 0px 1.2px 0px #afa38f inset;
  margin-top: 20px;
}
.unit-img-box {
  flex-shrink: 0;
  width: 380px;
  height: 220px;
  margin-top: 20px;
}
.unit-img-box2 {
  flex: 1;
  width: 340px;
}
.unit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #dcceb9;
}
.remarks1 {
  flex-shrink: 0;
  width: 380px;
  height: 160px;
  margin-top: 20px;
}
.remarks2 {
  flex-shrink: 0;
  width: 380px;
  margin-top: 40px;
}
.null-sub-img {
  justify-content: space-between;
}
</style>
